package com.yxw.live_vod_facade.feign;

import com.yxw.live_vod_facade.dto.OrderQueryDTO;
import com.yxw.live_vod_facade.vo.OrderVO;
import com.yxw.yxnet_cd_center.common.dto.PageVO;
import com.yxw.yxnet_cd_center.common.utils.BaseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "live-vod-boot", contextId = "order")
public interface OrderFeignClient {

    @ApiOperation(value = "后台获取订单列表")
    @PostMapping(value = "/api/order/get_order_list")
    public BaseResult<PageVO<OrderVO>> getOrderList(@RequestBody @Validated OrderQueryDTO queryDTO);

    @ApiOperation(value = "后台获取订单详情")
    @PostMapping(value = "/api/order/get_order_by_id")
    public BaseResult<OrderVO> getOrderById(@RequestParam("orderId") Long orderId);

    @ApiOperation(value = "根据商品id查询订单列表")
    @PostMapping(value = "/api/order/get_order_by_product")
    public BaseResult<List<OrderVO>> getOrderByProduct(@RequestParam("productId") Long productId);
}
